package org.sam.swing;

import javax.swing.JButton;
import javax.swing.JFrame;

/**
 * 带有折叠功能的工具栏
 * 
 * @author sam
 *
 */
public class JFrmCollect extends JFrame {

	private static final long serialVersionUID = -7305452160569187613L;

	/**
	 * 折叠panel
	 */
	private JPanelCollect panelCollect;

	/**
	 * 
	 */
	public JFrmCollect() {
		this.setLayout(null);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setSize(1024, 768);
		panelCollect = new JPanelCollect();
		panelCollect.setBounds(0, 0, 320, 640);
		this.add(panelCollect);
		
		JButton btn = new JButton("展开");
		btn.setBounds(0, 0, 75, 28);
		this.add(btn);
		btn.addActionListener(e ->{
			panelCollect.unCollect();
		});
	}

	/**
	 * 
	 * @param args
	 */
	public static void main(String... args) {
		JFrmCollect frm = new JFrmCollect();
		frm.setVisible(true);
	}
}
